#include<iostream>
#include<cstring>
#include<vector>
#include<map>
#include<cstdio>
#include<algorithm>
#include<string>
#include<string.h>
#include<queue>
#include<math.h>
#include<set>
#include<functional>
using namespace std;
using ull = unsigned long long;
using i128 = __int128_t;
inline int inc(int x,int v,int mod){x+=v;return x>=mod?x-mod:x;}//代替取模+
#define endl '\n'
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int,int> PII;
#define int long long

struct st{
    int first;
    int second;
};

bool cmp(st a, st b)
{
    if(a.second == b.second) return a.first > b.first;
    else return a.second < b.second;
}

void solve()
{  
    int n,s;
    cin >> n >> s;
    vector<st>arr(n + 10);
    int res = 0;
    for(int i = 1; i <= n; i ++) cin >> arr[i].first >> arr[i].second;
    for(int i = 1; i <= n; i ++) res += arr[i].first;
    
    sort(arr.begin() + 1, arr.begin() + 1 + n, cmp);
    int ans = 0;
    int cnt = 0;
    for(int i = 1; i <= n; i ++)
    {
        arr[i].second -= cnt;
        if(res <= s)
        {
            ans += arr[i].first * arr[i].second;
        }
        else
        {
            ans += s * arr[i].second;
            cnt += arr[i].second;
            res -= arr[i].first;
        }
    }
    cout << ans;
} 

signed main()
{
    int t = 1;
    //cin >> t;
    while(t --)
    {
        solve();
    }
}
